package csel.model.items;

import csel.model.entity.Entity;

public abstract class UseableItem extends TakeableItem{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 6L;

	public UseableItem(String name, String description, int flexPrice, String typeId)
	{
		super(name, description, flexPrice, typeId); //TODO
	}
	
	public abstract boolean use(Entity e);
	
	
	//calls touch on entity and if present then removes it.
	public boolean enter(Entity e)
	{
		if(e.touch(this))
		{
			//Is this TDA and LOD WOW??
			this.getLocation().setItem(null);
			return true;
		}
		return false;
	}
	
	public void leave(Entity e)
	{
		//default is that it does nothing........
	}

}
